package com.boyunv.adapter.example02;/*
 *@description
 *  对象适配器_组合形式
 *@author boyunv
 *@create 2023/7/23 14:17
 *@version 1.0
 */

import com.boyunv.adapter.example01.SDCard;
import com.boyunv.adapter.example01.TFCard;

public class SDAdapterTF2 implements SDCard {
    private TFCard  tfCard;

    public SDAdapterTF2(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter  read  tf  card");

        return tfCard.readTF();
    }

    @Override
    public void writeSD(String msg) {
        System.out.println("adapter  write  tf  card");
        tfCard.writeTF("") ;
    }
}
